﻿(function () {
    "use strict";

    document.body.onload = function () {
        var PlayButton = document.getElementById("playbutton");
        PlayButton.addEventListener("click", Play, false);
    }

    function Play() {
        var username = document.getElementById("username").value;
        if (username.length == 0) {
            document.getElementById("message").innerText = "Please input your name!"
        }
        else {
            window.localStorage.setItem("UserName", username);
            document.location = "game.html";
        }
    }
})();
